package org.redis.cluster.transport.netty.client;

import org.redis.cluster.config.ClientConfig;
import org.redis.cluster.transport.client.Client;
import org.redis.cluster.transport.client.ClientFactory;
import org.redis.cluster.transport.protocol.ProtocolDecoder;
import org.redis.cluster.transport.protocol.ProtocolEncoder;

public class NettyClientFactory implements ClientFactory {

	private ClientConfig config;
	private ProtocolDecoder decoder;
	private ProtocolEncoder encoder;
	
	public NettyClientFactory(ClientConfig config,ProtocolDecoder decoder,ProtocolEncoder encoder) {
		this.config=config;
		this.decoder=decoder;
		this.encoder=encoder;
	}
	
	@Override
	public Client getClient() {
		return new NettyClient(config, decoder, encoder);
	}

}